<template>
	<div>
		{{ $store.state.userInfo.username }}
		<el-button type="primary" size="default" @click="logout">注销</el-button>
	</div>
</template>

<script>
import { removeItem } from "@/utils/storage"
export default {
	methods: {
		logout() {
			// 注销，删除本地存储中的信息
			removeItem("userInfo");
			// 跳转到登录页面
			this.$router.push("/login");
		}
	},
};
</script>

<style lang="scss" scoped>
</style>
